import { defHttp } from '@/utils/http/axios';
import { BasicFetchResult } from '../model/baseModel';

interface basicType {
  id: number;
  address: string;
  field: string;
  companyName: string;
  contractName: string;
  state: number;
}

enum Api {
  GetContractTemplateList = '/findContractTemplate',
}

export const getContractTemplateList = (params?) => {
  return defHttp.post<BasicFetchResult<basicType>>({
    url: Api.GetContractTemplateList,
    data: params
  });
};

export const getContractTemplateInfoApi = async (id) => {
  const res = await getContractTemplateList({ id })
  return res?.[0] || {}
};
